import React from 'react'; 

const flag = false;

const type = 1; // 0|1|3

function getArticleJSX() {
  if (type === 0) {
    return <div>无图模式模版</div>;
  } else if (type === 1) {
    return <div>单图模式模版</div>;
  } else if (type === 3) {
    return <div>三图模式模版</div>;
  }
}

const clickHandler = (name, e) => {
  console.log('button按钮点击了', name, e);
};

// function handlerClick(){

// }

function Test1() {
  const [count, setCount] = React.useState(0);

  const handlerClick = () => {
    setCount(count + 2);
  };

  return (
    <div>
      this a App
      <br />
      {flag && <span>this is span</span>}
      <button onClick={e => clickHandler('jack', e)}>click me</button>
      {getArticleJSX()}
      <button onClick={() => setCount(count + 1)}>{count}</button>
      <button onClick={() => handlerClick()}>改变 count</button>
    </div>
  );
}
export default Test1;
